package com.xgzit.xgzmall.product.feign.fallback;

import com.xgzit.common.exception.BizCodeEnum;
import com.xgzit.common.utils.R;
import com.xgzit.xgzmall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 是对象调用，需要变成组件添加进容器
 * @Author xgz
 * @Date 2021-07-17 15:52
 */
@Slf4j
@Component
public class SeckillFeignServiceFallBack implements SeckillFeignService {

    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用... getSkuSeckillInfo");
        return R.error(BizCodeEnum.TOO_MANY_REQUEST.getCode(), BizCodeEnum.TOO_MANY_REQUEST.getMsg());
    }
}
